/*
 * 作者:熊猫
 * 日期:2017 - 3 - 15 4 - 40 - 50
 *
 */

package net.lainiao.morethread.Chapter6.demo8;

import java.util.concurrent.atomic.AtomicIntegerArray;

/**
 * Created by Administrator on 2017/3/15.
 */
public class Incrementer implements  Runnable {
    private AtomicIntegerArray vector;
    public Incrementer(AtomicIntegerArray vector){
        this.vector=vector;
    }
    @Override
    public void run() {
        for (int i = 0; i < vector.length(); i++) {
            vector.getAndIncrement(i);
        }
    }
}
